#include "IpScan.h" //Include your modified(from Template) .h

/*
	Using IPSCAN_DETECTOR module to try to detect ipscans
*/

template<typename T,typename R>
__device__ void COMPOUND_NAME(ANALYSIS_NAME,mining)(packet_t* GPU_buffer, T* GPU_data, R* GPU_results,analysisState_t state){
	
	/* CUDA CODE: Implement MINING code here */
	$IPSCAN_DETECTOR$AUTO_MINE();
}

template<typename T,typename R>
__device__ void COMPOUND_NAME(ANALYSIS_NAME,filtering)(packet_t* GPU_buffer, T* GPU_data, R* GPU_results,analysisState_t state){
	
	/* CUDA CODE: Implement PreAnalysis Routine Filtering here. Use predefined Filtering tool or Implement code here IF NECESSARY */

}

template<typename T,typename R>
__device__ void COMPOUND_NAME(ANALYSIS_NAME,analysis)(packet_t* GPU_buffer, T* GPU_data, R* GPU_results,analysisState_t state){

	/* CUDA CODE: Implement Analysis Routine here. Use a predefined Analysis or Implement code here */
	$IPSCAN_DETECTOR$ANALYSIS(15);

}

template<typename T,typename R>
__device__ void COMPOUND_NAME(ANALYSIS_NAME,operations)(packet_t* GPU_buffer, T* GPU_data, R* GPU_results,analysisState_t state){
	
	/* CUDA CODE: Implement post Analysis Operations/Filtering here. Use predefined Operations/Filtering tools or Implement code here IF NECESSARY */
	//$IPSCAN_DETECTOR$MULTI_THRESHOLDS$EXCLUDE(RESULT_ELEMENT.ipSrc==IP4(82,70,103,152)); //Exclude 82.70.103.152 from results
}

template<typename R>
void COMPOUND_NAME(ANALYSIS_NAME,hooks)(PacketBuffer* packetBuffer,R* results, analysisState_t state, int64_t* auxBlocks){
	
        /* HOST CODE: Implement HOOKS code here. Use predefined hooks or define new ones. */

	//Dump to stderr
	$IPSCAN_DETECTOR$DUMPER$DUMP_ALARMS_TO_STDERR(1,1);	

	//Dump to file
	//DUMP_IPSCAN_ALARMS_TO_FILE("IPSCAN.alarms",7,10);	
	
	//Dump to DB
	$IPSCAN_DETECTOR$DB_DUMPER$DUMP_ALARMS();



	//Example how to use PROGRAM_LAUNCHER
#if 0	
	$PROGRAM_LAUNCHER$PREPARE();
	$PROGRAM_LAUNCHER$ADD_TEXT_ARG("Test1 ipscan");
	$PROGRAM_LAUNCHER$ADD_TEXT_ARG("Test2 ipscan");
	$PROGRAM_LAUNCHER$ADD_TEXT_ARG("Test3 ipscan 1");
	$PROGRAM_LAUNCHER$ADD_ARG_AS_IP(ipSrc);
	$PROGRAM_LAUNCHER$EXECUTE("./prova.sh");
#endif
}


